//
//  FDHttpAPi.h
//  FD
//
//  Created by Yasin on 2018/10/13.
//  Copyright © 2018年 ZhiYuan Network. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "RBNetWorkTool.h"

typedef void(^FDHttpSuccessBlock)(id responseObjc);
typedef void(^FDHttpFailureBlock)(NSError *error);

@interface FDHttpAPi : NSObject
//+ (void)rb_POSTWithAPI:(NSString *)api parDic:(NSDictionary *)parDic successBlock:(FDHttpSuccessBlock)success fialureBlcok:(FDHttpFailureBlock)failure;

/**返回一个签名后的一个请求NSURLRequest*/
+ (NSURLRequest *)rb_requestWithUserOrderId:(NSString *)userOrderId;
/**根据urlstr返回一个返回一个设置了请求头的NSURLRequest对象*/
+ (NSURLRequest *)rb_URLRequestWithUrlAPI:(NSString *)api;

/**注册*/
+ (void)requestRegisterWithParDic:(NSDictionary *)parDic successBlock:(FDHttpSuccessBlock)success failureBlock:(FDHttpFailureBlock)failure;
/**65 注册时获取邮箱验证码*/
+ (void)requestRegisterEmailVerifyCodeWithEmial:(NSString *)email successBlock:(FDHttpSuccessBlock)success failBlock:(FDHttpFailureBlock)failure;


/**登陆*/
+ (void)requestLoginWithParDic:(NSDictionary *)parDic successBlock:(FDHttpSuccessBlock)success failureBlock:(FDHttpFailureBlock)failure;
/**退出登录*/
+ (void)requestLogoutSuccessBlock:(FDHttpSuccessBlock)success failBlock:(FDHttpFailureBlock)failure;
/**4.获取亚马逊云存储上传凭证*/
+ (void)requestAuthAmazonS3CloudStorageSuccessBlock:(FDHttpSuccessBlock)success failureBlock:(FDHttpFailureBlock)failure;

#pragma mark - 二 接口 首页
/**请求首页数据*/
+ (void)requestHomeSuccessBlock:(FDHttpSuccessBlock)success failBlock:(FDHttpFailureBlock)failure;
/**跳转商品详情页面 传商品id*/
+ (void)requestGoodsDetailWithGoodsId:(NSNumber *)goodsId Block:(FDHttpSuccessBlock)success failBlock:(FDHttpFailureBlock)failure;
/**21、获取外送点餐首页数据 goodsClassifyId:主分类编号 */
+ (void)requestSYGoodsListWithGoodsClassifyId:(NSNumber *)goodsClassifyId SuccessBlock:(FDHttpSuccessBlock)success failBlock:(FDHttpFailureBlock)failure;

/**27.添加到购物车(非套餐商品) 作废*/
+ (void)requestSYUserCartAddWithGoodId:(NSNumber *)goodsId quantity:(NSNumber *)quantity successBlock:(FDHttpSuccessBlock)success failBlock:(FDHttpFailureBlock)failure;
/**27-加入购物车*/
+ (void)requesSYUserCartAddWithParDic:(NSDictionary *)parDic successBlock:(FDHttpSuccessBlock)success failBlock:(FDHttpFailureBlock)failure;

/**29.购物车商品修改数量 {数量，购物车id}*/
+ (void)requestSYUserCartUpdateQuantity:(NSNumber *)quantity cartId:(NSNumber *)cartId successBlock:(FDHttpSuccessBlock)success failBlock:(FDHttpFailureBlock)failure;

/**30.购物车移除商品 参数传{购物车id}*/
+ (void)requestSYUserCartRemoveCartId:(NSNumber *)cartId successBlock:(FDHttpSuccessBlock)success failBlock:(FDHttpFailureBlock)failure;

/**31、获取购物车数据 和 获取外送点餐接口同时调用*/
+ (void)requestSYUserCartListSuccessBlock:(FDHttpSuccessBlock)success failBlock:(FDHttpFailureBlock)failure;

/**37.获取优惠券列表*/
+ (void)requestSYCouponListSuccessBlock:(FDHttpSuccessBlock)success failBlock:(FDHttpFailureBlock)failure;
/**38.可用的优惠券*/
+ (void)requestSYUserCouponUsableSuccessBlock:(FDHttpSuccessBlock)success failBlock:(FDHttpFailureBlock)failure;
/**39.获取过期的优惠券列表*/
+ (void)requestSYUserCouponInvalidSuccessBlock:(FDHttpSuccessBlock)success failBlock:(FDHttpFailureBlock)failure;
/**首页-门店预约接口数据*/
+ (void)requestSYShopListSuccessBlock:(FDHttpSuccessBlock)success failureBlock:(FDHttpFailureBlock)failure;
/**获取店铺详情*/
+ (void)requestSYShopDetailId:(NSNumber *)shopId successBlock:(FDHttpSuccessBlock)success failBlock:(FDHttpFailureBlock)failure;


#pragma mark - 三 接口 发现
/**获取发现也数据*/
+ (void)requestFindDataSuccessBlock:(FDHttpSuccessBlock)success failBlock:(FDHttpFailureBlock)failure;


#pragma mark - 四 优惠券
/**领取优惠券
 备注: 服务器要求传 JSON , OC中的数字默认都是NSNumber 类型。传NSString 会报错：参数类型不匹配
 */
+ (void)requestObtainCouponWithId:(NSNumber *)couponId successBlock:(FDHttpSuccessBlock)success failBlock:(FDHttpFailureBlock)failure;


#pragma mark - 五 订单相关
/**44. 订单预览 外卖-底部-点击结算按钮调的接口*/
+ (void)requestDDOrderPreviewSuccessBlock:(FDHttpSuccessBlock)success failureBlock:(FDHttpFailureBlock)failBlock;

/**45.获取订单优惠券列表*/
+ (void)requestDDOrderCouponWithOrderAmount:(NSNumber *)orderAmount successBlock:(FDHttpSuccessBlock)success failBlock:(FDHttpFailureBlock)failure;

/***47 提交订单
 {
 "userCouponId": null,
 "userCartIdList": [648, 392],
 "userShippingAddressId": 15,
 "deliveryType": 0,
 "remark": ""
 }
 */
+ (void)requestDDOrderSumitParDic:(NSDictionary *)parDic successBlock:(FDHttpSuccessBlock)success failBlock:(FDHttpFailureBlock)failure;

/**
 48 获取订单列表

 @param deliveryType 0:外卖 1:自提
 @param status 数组； 为空，则查找所有订单 {"deliveryType":0,"status":[0]}
 */
+ (void)requestDDOrderListWithDeliveryType:(NSNumber *)deliveryType status:(NSArray *)status successBlock:(FDHttpSuccessBlock)success failBlock:(FDHttpFailureBlock)failure;

/**51. 获取门店预约接口数据 这里有坑 必须传 空字典 {}*/
+ (void)requestDDShopReservationSuccessBlock:(FDHttpSuccessBlock)success failBlock:(FDHttpFailureBlock)failure;


#pragma mark - 我的页面
+ (void)requestUserMySuccessBlock:(FDHttpSuccessBlock)sucess failBlock:(FDHttpFailureBlock)failure;

/**意见反馈接口*/
+ (void)requestUserFadebackWithContent:(NSString *)content successBlock:(FDHttpSuccessBlock)success failBlock:(FDHttpFailureBlock)failure;
/**5、修改昵称*/
+ (void)requestUserUpdateNickname:(NSString *)nickname successBlock:(FDHttpSuccessBlock)success failBlock:(FDHttpFailureBlock)failure;

/**6.修改头像接口*/
+ (void)requestUserUpdateTouXiangStr:(NSString *)headName successBlock:(FDHttpSuccessBlock)success failBlock:(FDHttpFailureBlock)failure;

/**7.修改手机号*/
+ (void)requestUserUpdatePhone:(NSString *)phone successBlock:(FDHttpSuccessBlock)success failBlock:(FDHttpFailureBlock)failure;
/***8.修改性别 0：男 1：女*/
+ (void)requestUserUpdateSex:(NSNumber *)sex successBlock:(FDHttpSuccessBlock)success fialBlock:(FDHttpFailureBlock)failure;
/**9.修改生日 请传13位的时间戳 NSNumser */
+ (void)requestUserUpdateBirthday:(NSNumber *)birthday successBlock:(FDHttpSuccessBlock)success failBlock:(FDHttpFailureBlock)failure;

/**10请求用户个人信息*/
+ (void)requestUserPersonMsgSuccessBlock:(FDHttpSuccessBlock)success failBlock:(FDHttpFailureBlock)failure;
/**11、获取用户的偏好标签*/
+ (void)requestUserLabelListSuccessBlock:(FDHttpSuccessBlock)success failBlock:(FDHttpFailureBlock)failure;
/**12.获取所有标签列表*/
+ (void)requestUserLabelOptionListSuccessBlock:(FDHttpSuccessBlock)success failBlock:(FDHttpFailureBlock)failure;
/***13.保存标签*/
+ (void)requestUserLabelSaveTagId:(NSNumber *)tagId successBlock:(FDHttpSuccessBlock)success failBlock:(FDHttpFailureBlock)failure;
/***14.删除标签*/
+ (void)requestUserLabelRemoveTagId:(NSNumber *)tagId successBlock:(FDHttpSuccessBlock)success failBlock:(FDHttpFailureBlock)failure;

/** 17.新增家庭成员 @param name 姓名  @param timeStamp 13位的时间戳 下同 */
+ (void)requestUserFamilSaveName:(NSString *)name birthdaystamp:(NSNumber *)timeStamp successBlock:(FDHttpSuccessBlock)succcess failBlock:(FDHttpFailureBlock)failure;
/**18.编辑家庭成员信息*/
+ (void)requestUserFamilUpdateName:(NSString *)memberName birthdaystamp:(NSNumber *)timestamp memberId:(NSNumber *)memberid successBlock:(FDHttpSuccessBlock)success failBlock:(FDHttpFailureBlock)failure;
/**19.获取家庭成员列表*/
+ (void)requestUserFamilListSuccessBlock:(FDHttpSuccessBlock)success failBlock:(FDHttpFailureBlock)failure;
/**20.移除家庭成员信息*/
+ (void)requestUserFamilRemoveMemberId:(NSNumber *)memberId successBlock:(FDHttpSuccessBlock)success failBlock:(FDHttpFailureBlock)failure;



/**40.新增收货地址 参数较多，直接传一个大字典算了
 2019-1-7 第一个region，修改后， 你给我传空字符串"" 或者 null就行
 下面的 zipCode houseNumber 分别表示邮政编码与门牌号码
 */
+ (void)requestUserAddressAddressAddWithParDic:(NSDictionary *)dic successBlock:(FDHttpSuccessBlock)success failBlock:(FDHttpFailureBlock)failure;
/**41-编辑收货地址*/
+ (void)requestUserAddressEditWithParDic:(NSDictionary *)dic successBlock:(FDHttpSuccessBlock)succes failBlock:(FDHttpFailureBlock)failure;

/**40-1调用googleAP将文字地址-->坐标*/
+ (void)requestGoogleAPISGetGeometryWithAddress:(NSString *)address successBlock:(RBSuccessBlock)success failBlock:(RBFailureBlock)failure;
/**40-2调用googleAPI地理反编码.将经纬度转换为地名*/
+ (void)requestGoogleAPIReverseGeocodeUrl:(NSString *)urlStr successBlock:(void(^)(NSString *address))success failBlock:(RBFailureBlock)failure;


/**42.删除收货地址*/
+ (void)requestUserAddressRemoveWithID:(NSNumber *)addressId succesBlock:(FDHttpSuccessBlock)success failBlock:(FDHttpFailureBlock)failure;
/**43.获取收货地址列表*/
+ (void)requestUserShouHuoAddressSucccessBlock:(FDHttpSuccessBlock)success fialBlock:(FDHttpFailureBlock)failure;
/**49.订单详情 字符串*/
+ (void)requestUserOrderDetailOrderId:(NSString *)orderId successBlock:(FDHttpSuccessBlock)success failBlock:(FDHttpFailureBlock)failure;

/**50.用户预约*/
+ (void)requestUserLiJiYuyuePardic:(NSDictionary *)parDic successBlock:(FDHttpSuccessBlock)success failBlock:(FDHttpFailureBlock)failure;
/**52.获取预约门店信息*/
+ (void)requestUserYuYueShopMesssageWithYuYueId:(NSNumber *)yuyueId successBlock:(FDHttpSuccessBlock)success failBlock:(FDHttpFailureBlock)failure;
/**53.预约订单详情*/
+ (void)requestUserYuYueOrderDetailWithUserOrderId:(NSString *)userOrderId successBlock:(FDHttpSuccessBlock)success failBlock:(FDHttpFailureBlock)failure;

/**55.查询订单订单状态
 前提条件根据这个接口 /user/order/detail 返回的 status字段做判断
 status    0 不处理     忽略
           [1,2,3,4]  本接口固定传一个数组[@1,@2,@3,@4] (已下单、制作中、派送中、已完成)
 对应的代付款、待评价订单详情
 
           [6,7,8]    本接口固定传一个数组[@6,@7,@8] (取消订单、退款中,退款成功)
 对应退款、售后订单详情
 ========================
 */
+ (void)requestUserOrderStatusWithOrderId:(NSString *)orderId Status:(NSArray <NSNumber *> *)status successBlock:(FDHttpSuccessBlock)success failBlock:(FDHttpFailureBlock)failure;
/**56.评价订单*/
+ (void)requestUserEvaluteOrederWithParDic:(NSDictionary *)parDic successBlock:(FDHttpSuccessBlock)success fialBlock:(FDHttpFailureBlock)failure;
/**57.门店订单评价列表接口*/
+ (void)requestUserShopOrderEvaluateListWithShopId:(NSNumber *)shopId successBlock:(FDHttpSuccessBlock)success fialBlock:(FDHttpFailureBlock)failure;

/**57.积分明细*/
+ (void)requestJiFenMingXiSuccessBlock:(FDHttpSuccessBlock)success fialBlock:(FDHttpFailureBlock)failure;
/**58.获取亚马逊云存储上传多张图片名字*/
+ (void)requestAWSS3MultipleWithQuantity:(NSInteger)quantity successBlock:(FDHttpSuccessBlock)success fialBlock:(FDHttpFailureBlock)failure;
/**59 获取商家配送范围,超出配送范围时调用此接口 */
+ (void)requestUserShopRangListSuccessBlock:(FDHttpSuccessBlock)success failBlock:(FDHttpFailureBlock)failure;
/**60.客服电话*/
+ (void)requestKeFuDianHuaSuccessBlock:(FDHttpSuccessBlock)success failBlock:(FDHttpFailureBlock)failure;
/**61.营业时间*/
+ (void)requestYinGYeShiJianSuccessBlock:(FDHttpSuccessBlock)success failBlock:(FDHttpFailureBlock)failure;

/**62.判断用户坐标点是否在配送范围, 超出配送范围时调用此接口
 */
+ (void)requestUserShopInRnageWithLongitude:(NSNumber *)longitude latitude:(NSNumber *)latitude successBlock:(FDHttpSuccessBlock)success failBlock:(FDHttpFailureBlock)failure;
/**66.找回密码发送验证码*/
+ (void)requestUserFindPWdSendCodeWithEmail:(NSString *)email successBlock:(FDHttpSuccessBlock)success failBlock:(FDHttpFailureBlock)failure;
/**67.找回密码 废弃*/
+ (void)requestChangePwdPardic:(NSDictionary *)parDic successBlock:(FDHttpSuccessBlock)success failBlock:(FDHttpFailureBlock)failure;
/***69.获取订单支付链接*/
+ (void)requestUserOrderPaymentUrlWithOrderId:(NSString *)userOrderId successBlock:(FDHttpSuccessBlock)success fialBlock:(FDHttpFailureBlock)failure;
/**70.修改密码*/
+ (void)requestUserUpdatePasswordJiuPwd:(NSString *)jiupwd xinstr:(NSString *)xin surePWd:(NSString *)surepwd scucessBlock:(FDHttpSuccessBlock)success failBlock:(FDHttpFailureBlock)failure;


/**72.首页查看配送范围*/
+ (void)requestHomeShopRanageListV2SuccessBlock:(FDHttpSuccessBlock)success failureBlock:(FDHttpFailureBlock)failure;

/**
 73.获取运费

 @param userShippingAddressId 用户收货地址编号
 */
+ (void)requestFreightWithUserShippingAddressId:(NSNumber *)userShippingAddressId successBlock:(FDHttpSuccessBlock)success failBlock:(FDHttpFailureBlock)failure;


/**75.再来一单 预览*/
+ (void)requestZaiLaiYiDanPreviewWithUserOrderId:(NSString *)orderId successBlock:(FDHttpSuccessBlock)success failureBlock:(FDHttpFailureBlock)failure;
/**76.再来一单 提交*/
+ (void)requestZaiLaiYiDanSubmitWithParamDic:(NSDictionary *)parDic successBlock:(FDHttpSuccessBlock)success failureBlock:(FDHttpFailureBlock)failure;
/**77.加载商品介绍模板文本*/
+ (void)requestGoodsDetailDescribeTemplateSuccessBlock:(FDHttpSuccessBlock)success failureBlock:(FDHttpFailureBlock)failure;
/**2018-12-30加载首页轮播图模板*/
+ (void)requestHomeWhirligigTempleateSuccessBlock:(FDHttpSuccessBlock)success failBlock:(FDHttpFailureBlock)failure;
/**12-31请求商品列表轮播图列表*/
+ (void)requestGoodsListWhirligigSuccessBlock:(FDHttpSuccessBlock)success failBlock:(FDHttpFailureBlock)failure;

#pragma mark - 七11-19 接口修改
/**修改:商品类目*/
+ (void)requestShangPinNeiMuSuccessBlock:(FDHttpSuccessBlock)success failBlock:(FDHttpFailureBlock)failure;

/**79.获取订单详情--骑手信息
 调用时机： 条件改一下，订单配送方式为外送(delivery_type=0) 并且订单状态不等于0、1、2
 
 */
+ (void)requestOrderDetailRiderMessageWithOrderId:(NSString *)orderId successBlock:(FDHttpSuccessBlock)success failBlock:(FDHttpFailureBlock)failure;

/**84 获取消息推送模板*/
+ (void)requestHtmlTemplatePushSuccessBlock:(FDHttpSuccessBlock)success failBlock:(FDHttpFailureBlock)failure;

/**87.线上支付*/
+ (void)requestPayOnlineWithOrderId:(NSString *)orderId successBlock:(FDHttpSuccessBlock)success failBlock:(FDHttpFailureBlock)failure;

/**88.线下支付*/
+ (void)requestPayOfflineWithOrderId:(NSString *)orderId successBlock:(FDHttpSuccessBlock)success failBlock:(FDHttpFailureBlock)failure;



@end
